<html lang=<?php echo $config['lang']; ?>>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
        <style>
<?php include('global.css'); ?>
<?php include('front.css'); ?>
<?php if ( file_exists( "fix.css" ) ) { include( "fix.css" ); } ?>
        </style>
    </head>
    <body>
        <div class=info-box></div>
        <?php include('header.php'); ?>
        <div class='banner'><img src='/img/install_banner.jpg'></div>
        <main>
        <?php

        $is_owner = is_owner();

        if ( $is_owner && file_exists( $soc['dir'].'/hidden.php' ) ) {
            include( $soc['dir'].'/hidden.php' );
        } else {
            $hidden = array();
        }

        $soc['feed'] = array();
        foreach( glob($soc['dir'].'/.posts/*/*/*/*/*/index.json') as $file ) {
            $json = json_decode( file_get_contents( $file ), true );
            if ( $is_owner ) {
                if ( !isset( $hidden[ $json['id'] ] ) ) {
                    $soc['feed'][] = $json;
                }
            } elseif ( $json['public'] === 'true' ) {
                $soc['feed'][] = $json;
            }
        }

        // Получить посты из других источников
        if ( $is_owner ) {
            soc_do_stage('get_posts');
        }

        soc_rsort( $soc['feed'], 'created' );
        

        foreach( $soc['feed'] as $json ) {
            if ( !isset( $hidden[ $json['id'] ] ) ) {
                include('teaser.php');
            }
        }

        ?>
        </main>
        <?php include('footer.php'); ?>
    </body>
</html>